home *** CD-ROM | disk | FTP | other *** search
/ Hottest 6 / Hottest 6 (1996)(PDSoft)[!].iso / software / videoutils / a-g / ami2d / macros / genline.rexx < prev    next >
OS/2 REXX Batch file  |  1978-11-24  |  739b  |  40 lines

  1. /* script to generate nodes between two existing nodes */
  2. options results
  3.  
  4. address ami2d
  5.  
  6. if ~show('l', "rexxmathlib.library") then do
  7.     check = addlib('rexxmathlib.library',0,-30,0)
  8. end
  9.  
  10. 'info(node)'
  11. f1 = result
  12. parse var f1 nd i1a x1a y1a
  13. if i1a = 0 then exit
  14. 'info(node)'
  15. f2 = result
  16. parse var f2 nd i1b x1b y1b
  17. if i1b = 0 then exit
  18. if i1a > i1b then do
  19.     parse var f2 nd i1a x1a y1a
  20.     parse var f1 nd i1b x1b y1b
  21. end
  22.  
  23. in = i1b - i1a
  24.  
  25. 'get inodes'
  26. if length(result) > 0 then ni = result%1 - 1
  27. else ni = in
  28. 'set inodes 'ni + 1
  29. 'get igrad'
  30. if length(result) > 0 then gi = result
  31. else gi = 1
  32.  
  33. do i=0 to ni
  34.     n = i1a + i
  35.     xn = x1a + (x1b-x1a)*pow(i/ni,gi)
  36.     yn = y1a + (y1b-y1a)*pow(i/ni,gi)
  37.     'node('n','xn','yn')'
  38. end
  39. exit
  40.